<template>
	<view class="wrap">
		<view class="care-all">
			<view class="cate-section">
				<view class="cate-item" v-for="item in pageList" @tap="goPages(item)" :key='item.pageid'>
					<image v-if="project>=item.pageid" :src="item.urlOne"></image>
					<image v-else :src="item.urlTwo"></image>
					<text>{{item.title}}</text>
				</view>
			</view>
		</view>	
		<view class="tabbar-box" v-if="showTabbar">
			<tab-bar :navs="navs" :counts="navCounts" :current="navCurrent" @onChange="onNavBarChange"></tab-bar>
		</view>
		
		<view class="page-box" v-if="showPage.show1">
			<tab-page-one ref='childOne' v-show="navCurrent===0" :pageData="pageData" :changeListData='changeListData'></tab-page-one>
			<tab-page-two ref='childTwo' v-show="navCurrent===1" :pageData="pageData" :changeListData='changeListData'></tab-page-two>
			<tab-page-the ref='childThree' v-show="navCurrent===2" :pageData="pageData" :changeListData='changeListData'></tab-page-the>
		</view>
		<view class="page-box" v-else-if="showPage.show2">
			<tab-page-four ref='childfour' v-show="navCurrent===0" :pageData='pageData'></tab-page-four>
			<tab-page-five ref='childfive' v-show="navCurrent===1" :pageData='pageData' :changeListData='changeListData' @getIndex='getIndexes'></tab-page-five>
			<tab-page-six  ref='childsix' v-show="navCurrent===2" :pageData='pageData'></tab-page-six>
		</view>
		<view class="page-box" v-else-if="showPage.show3">
			<tab-page-seve ref='childPageSeve' v-show="showPage.show3" :pageData='pageData' @getIndex='getIndexes'></tab-page-seve>
		</view>
		<view class="page-box" v-else-if="showPage.show4">
			<tab-page-eight ref='childPageEight' v-show="showPage.show4" :pageData='pageData' @getIndex='getIndexes'></tab-page-eight>
		</view>
		<view class="page-box" v-else-if="showPage.show5">
			<tab-page-nine ref='childPageNine' v-show="showPage.show5" :pageData='pageData'></tab-page-nine>
		</view>
		<view class="page-box" v-else-if="showPage.show6">
			<tab-page-ten ref='childSevenOne' v-show="navCurrent===0" :pageData='pageData'></tab-page-ten>
			<tab-page-eleven  ref='childSevenTwo' v-show="navCurrent===1" :pageData='pageData'  :changeListData='changeListData'></tab-page-eleven>
		</view>
		<view class="page-box" v-else-if="showPage.show7">
			<tab-page-twelve v-show="showPage.show7" ref='childSeven' :pageData='pageData' :personData='personData'></tab-page-twelve>
		</view>
		<view class="page-box" v-else-if="showPage.show8">
			<tab-page-thirteen  v-show="showPage.show8" ref='childEight' :pageData='pageData'></tab-page-thirteen>
		</view>
		<view class="page-box" v-else-if="showPage.show9">
			<tab-page-fourteen v-show="showPage.show9" ref='childNine' :pageData='pageData'></tab-page-fourteen>
		</view>
		<view class="page-box" v-else-if="showPage.show10">
			<tab-page-fifteen v-show="navCurrent===0"  ref='childTenone' :pageData='pageData'></tab-page-fifteen>
			<tab-page-sixteen v-show="navCurrent===1"  ref='childTentwo':pageData='pageData' :changeListData='changeListData'></tab-page-sixteen>
			<tab-page-seventeen v-show="navCurrent===2"  ref='childTenthe' :pageData='pageData'></tab-page-seventeen>
		</view>
		
		<view class="fixed-action-bar">
			<view class="item" @click="handleSave()">
				<view class="btn-box">
					<image src="../../../static/images/icon_save.png" mode="widthFix" class="icon"></image>
					<text class="text-edit">立即保存</text>
				</view>
			</view>
			<view class="item" @click="handleNext" v-if="!showPage.show10">
				<view class="btn-box">
					<image src="../../../static/images/icon_next.png" mode="widthFix" class="icon"></image>
					<text class="text-delete">下一阶段</text>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import tabBar from '../components/tab-bar.vue';
	import tabPageOne from './components/tab-page-one.vue'
	import tabPageTwo from './components/tab-page-two.vue'
	import tabPageThe from './components/tab-page-the.vue'
	import tabPageFour from './components/tab-page-four.vue'
	import tabPageFive from './components/tab-page-five.vue'
	import tabPageSix from './components/tab-page-six.vue'
	import tabPageSeve from './components/tab-page-seve.vue';
	import tabPageEight from './components/tab-page-eight.vue';
	import tabPageNine from './components/tab-page-nine.vue';
	import tabPageTen from './components/tab-page-ten.vue';
	import tabPageEleven from './components/tab-page-eleven.vue';
	import tabPageTwelve from './components/tab-page-twelve.vue';
	import tabPageThirteen from './components/tab-page-thirteen.vue';
	import tabPageFourteen from './components/tab-page-fourteen.vue';
	import tabPageFifteen from './components/tab-page-fifteen.vue';
	import tabPageSixteen from './components/tab-page-sixteen.vue';
	import tabPageSeventeen from './components/tab-page-seventeen.vue';
	export default {
		components:{
			tabBar,
			tabPageOne,
			tabPageTwo,
			tabPageThe,
			tabPageFour,
			tabPageFive,
			tabPageSix,
			tabPageSeve,
			tabPageEight,
			tabPageNine,
			tabPageTen,
			tabPageEleven,
			tabPageTwelve,
			tabPageThirteen,
			tabPageFourteen,
			tabPageFifteen,
			tabPageFifteen,
			tabPageSixteen,
			tabPageSeventeen
		},
		data() {
			return {
				pageList:[
					{pageid:1 ,title:"项目入库",urlOne:'/static/images/project_nav_001.png',urlTwo:'/static/images/project_nav_101.png'},
					{pageid:2 ,title:"项目评估",urlOne:'/static/images/project_nav_002.png',urlTwo:'/static/images/project_nav_102.png'},
					{pageid:3 ,title:"项目核查",urlOne:'/static/images/project_nav_003.png',urlTwo:'/static/images/project_nav_103.png'},
					{pageid:4 ,title:"项目再评估",urlOne:'/static/images/project_nav_004.png',urlTwo:'/static/images/project_nav_104.png'},
					{pageid:5 ,title:"商务谈判",urlOne:'/static/images/project_nav_005.png',urlTwo:'/static/images/project_nav_105.png'},
					{pageid:6 ,title:"合同签署",urlOne:'/static/images/project_nav_006.png',urlTwo:'/static/images/project_nav_106.png'},
					{pageid:7 ,title:"公司登记",urlOne:'/static/images/project_nav_007.png',urlTwo:'/static/images/project_nav_107.png'},
					{pageid:8 ,title:"项目供地",urlOne:'/static/images/project_nav_008.png',urlTwo:'/static/images/project_nav_108.png'},
					{pageid:9 ,title:"项目建设",urlOne:'/static/images/project_nav_009.png',urlTwo:'/static/images/project_nav_109.png'},
					{pageid:10 ,title:"投后服务",urlOne:'/static/images/project_nav_010.png',urlTwo:'/static/images/project_nav_110.png'}
				],
				showPage:{show1:false,show2:false,show3:false,show4:false,show5:false,show6:false,show7:false,show8:false,show9:false,show10:false},
				navCounts: [], //订单数量
				navs: [
					{name: '本周报送'},
					{name: '本季跟进'},
					{name: '本季跟进'},
				],
				dicData:{},
				project:null,//项目阶段
				navCurrent: 0, //当前tab
				code:'',
				pageData:{},//页面总参数
				sendListData:{},
				renmingData:[],//跟进负责人
				zhutiData:[],//主体名称
				zhongjieData:[],//中介机构名称
				changeListData:{},
				showTabbar:false,
				prostage:0,//当前阶段
				personData:[],//跟进人参数
				pageForIndex:0,
				itemPageIndex:0,
				pageForData:{},
				pageThis:null,
				savelog:'',
				goBack:true,
			}
		},
		methods: {
			initShow(){
				this.goBack=true
				this.showTabbar=false
				this.navCurrent=0
				this.showPage={show1:false,show2:false,show3:false,show4:false,show5:false,show6:false,show7:false,show8:false,show9:false,show10:false}
			},
			handleSave(){
				uni.showModal({
					title: '提示',
					content: '是否保存本次修改记录？',
					cancelText: "否", // 取消按钮的文字  
					confirmText: "是", // 确认按钮文字  
					showCancel: true, // 是否显示取消按钮，默认为 true
					confirmColor: '#f55850',
					cancelColor: '#39B54A',
					success: (res) => {
						if(res.confirm){
							if(this.pageData.model.CURR_PROJ_STAGE>4){
								this.savelog='Y'
							}
							if(this.prostage===1){
								this.handleSaveOne()
							}else if(this.prostage===2){
								this.handleSaveTwo()
							}else if(this.prostage===3){
								this.handleSaveThree()
							}else if(this.prostage===4){
								this.handleSaveFour()
							}else if(this.prostage===5){
								this.handleSaveFive()
							}else if(this.prostage===6){
								this.handleSaveSix()
							}else if(this.prostage===7){
								this.handleSaveSeven()
							}else if(this.prostage===8){
								this.handleSaveEight()
							}else if(this.prostage===9){
								this.handleSaveNine()
							}else if(this.prostage===10){
								this.handleSaveTen()
							}		
						}
					} 
				})
			},
			async handleSaveOne(){
				this.sendListData={}
				let pageOneData=this.$refs.childOne.sendData
				let pageOneFileList=this.$refs.childOne.newFileList
				let pageTwoData=this.$refs.childTwo.sendData
				let pageTwoDataDelete=this.$refs.childTwo.deleteList
				let pageThreeData=this.$refs.childThree.sendData
				let pageThreeListDelete=this.$refs.childThree.listDataDeletet
				let pageThreeWorkDelete=this.$refs.childThree.workDataDeletet
				let projSubjectListData={}
				let teamMemberEditListData={}
				let temaWorkEditListData={}
				let attachObj={}
				this.sendListData.DATAKEY=this.code
				this.sendListData.PROJ_STAGE=this.pageData.model.PROJ_STAGE
				this.sendListData.NAME=pageOneData.proName
				this.sendListData.CODE=pageOneData.proNumber
				this.sendListData.SOURCE=pageOneData.laiyuan_value
				this.sendListData.ORGANIZATION=pageOneData.zhongjie_value
				this.sendListData.PROJ_START_UP=pageOneData.date
				this.sendListData.CREATEWORKGROUP=pageOneData.group
				this.sendListData.INDUSTRY=pageOneData.hangye_value
				this.sendListData.PROJ_APPEAL=pageOneData.suqiu_value
				this.sendListData.REMARK=pageOneData.beizhu
				this.sendListData.PROJ_SURVEY=pageOneData.jianjie
				this.sendListData.EXPECT_INVEST=pageOneData.zongtouzi
				this.sendListData.EXPECT_OUT_START=pageOneData.min_touzi
				this.sendListData.EXPECT_OUT_END=pageOneData.max_touzi
				this.sendListData.EVALUATE=pageOneData.rateData
				if(this.pageData.model.CURR_PROJ_STAGE>4&&this.savelog==='Y'){
					this.sendListData.savelog='Y'
				}
				if(pageTwoData){
					let projSubjectStr=''
					let pageTwoDataAllList=[]
					pageTwoDataAllList=pageTwoDataDelete.concat(pageTwoData.listData)
					this.sendListData['proj_subject.totalNum']=pageTwoDataAllList.length
					if(pageTwoDataAllList.length){
						for(var i=0;i<pageTwoDataAllList.length;i++){
							projSubjectStr+=`proj_subject.EDITTYPE-${i}:`+pageTwoDataAllList[i].leixing+';'+`proj_subject.DATAKEY-${i}:`+pageTwoDataAllList[i].datakey+';'
							+`proj_subject.PROJ_ID-${i}:`+pageTwoDataAllList[i].proid+';'+`proj_subject.INVESTOR-${i}:`+pageTwoDataAllList[i].zhutiming+';'
							+`proj_subject.INVESTOR_A-${i}:`+pageTwoDataAllList[i].zhucedi+';'+`proj_subject.INVESTOR_B-${i}:`+pageTwoDataAllList[i].lianxiren+';'
							+`proj_subject.INVESTOR_C-${i}:`+pageTwoDataAllList[i].lianxifang+';'
						}
						projSubjectListData=this.changeStr(projSubjectStr)
					}
				}
				this.sendListData.REMARK1=pageTwoData.beizhu
				if(pageOneFileList&&pageOneFileList.length){
					this.sendListData.newAttachId=pageOneFileList[0].dataKey
				}
				if(pageThreeData){
					let teamMemberEditStr=''
					let pageThreeDataAllList=[]
					pageThreeDataAllList=pageThreeListDelete.concat(pageThreeData.listData)
					this.sendListData['TeamMember_edit.totalNum']=pageThreeDataAllList.length
					if(pageThreeDataAllList.length){
						for(var i=0;i<pageThreeDataAllList.length;i++){
							teamMemberEditStr+=`TeamMember_edit.EDITTYPE-${i}:`+pageThreeDataAllList[i].leixing+';'+`TeamMember_edit.DATAKEY-${i}:`+pageThreeDataAllList[i].datakey+';'
							+`TeamMember_edit.PROJ_ID-${i}:`+pageThreeDataAllList[i].proid+';'+`TeamMember_edit.MEMBER-${i}:`+pageThreeDataAllList[i].genjinren+';'
							+`TeamMember_edit.LINK_TEL-${i}:`+pageThreeDataAllList[i].lianxifang+';'+`TeamMember_edit.WORK-${i}:`+pageThreeDataAllList[i].zhuyaozhi+';'
						}
						teamMemberEditListData=this.changeStr(teamMemberEditStr)
					}
				}
				if(pageThreeData){
					let temaWorkEditStr=''
					let pageThreeDataAllWork=[]
					pageThreeDataAllWork=pageThreeWorkDelete.concat(pageThreeData.workData)
					this.sendListData['TemaWork_edit.totalNum']=pageThreeDataAllWork.length
					if(pageThreeDataAllWork.length){
						for(var i=0;i<pageThreeDataAllWork.length;i++){
							temaWorkEditStr+=`TemaWork_edit.EDITTYPE-${i}:`+pageThreeDataAllWork[i].leixing+';'+`TemaWork_edit.DATAKEY-${i}:`+pageThreeDataAllWork[i].datakey+';'
							+`TemaWork_edit.PROJ_ID-${i}:`+pageThreeDataAllWork[i].proid+';'+`TemaWork_edit.PLAN_DATE-${i}:`+pageThreeDataAllWork[i].date+';'
							+`TemaWork_edit.CONTENT-${i}:`+pageThreeDataAllWork[i].content+';'
						}
						temaWorkEditListData=this.changeStr(temaWorkEditStr)
					}
				}
				
				this.sendListData.MANAGER=pageThreeData.fuzeren_value
				this.sendListData.TEAM_REMARK=pageThreeData.beizhu
				this.sendListData.isadding=false					//表单标记，true新增表单，false修改表单
				this.sendListData.submit= 1		//是否提交，1为提交
				// //附件相关记录表
				// attach:[],
				// removeAttachId: b9f1e77c99a14899b7dee60a1b03035e				//删除的附件主键
				// removeAttachId: 7b7f1b84c3694e7b821c298767760025	
				uni.showLoading()
				const res = await this.$req({
					url:'wxbus/proj/save.do',
					method:'POST',
					data:{...this.sendListData,...projSubjectListData,...teamMemberEditListData,...temaWorkEditListData}
				})
				uni.hideLoading()
				if(res.data.success){
					uni.showToast({
						title:'编辑成功',
						icon:'none'
					})
					//刷新详情和列表
					uni.$emit("refreshDetailData", {});
					uni.$emit("refreshDataList", {})
					if(this.goBack){
						uni.navigateBack()
					}else{
						this.goPages(this.pageList[this.prostage])
					}
				}else{
					uni.showToast({
						title:res.data.messages[0].content,
						icon:'none'
					})
				}
			},
			async handleSaveTwo(){
				this.sendListData={}
				let pageOneFileList=this.$refs.childfour.newFileList //文件
				let pageTwoData=this.$refs.childfive.sendDataList  //列表
				let pageTwoDataDelete=this.$refs.childfive.deletetDataList //删除的列表
				let projSubjectListData={}
				let pageThreeData=this.$refs.childsix.sendDataList
				let pageThreeFileList=this.$refs.childsix.newFileList //文件
				if(pageOneFileList&&pageOneFileList.length){
					this.sendListData.newAttachId=pageOneFileList[0].dataKey
				}
				if(pageThreeFileList&&pageThreeFileList.length){
					this.sendListData.newAttachId=pageThreeFileList[0].dataKey
				}
				if(this.pageData.model.CURR_PROJ_STAGE>4&&this.savelog==='Y'){
					this.sendListData.savelog='Y'
				}
				if(pageTwoData){
				 	let projSubjectStr=''
				 	let pageTwoDataAllList=[]
				 	pageTwoDataAllList=pageTwoDataDelete.concat(pageTwoData)
				 	this.sendListData['Discuss_edit.totalNum']=pageTwoDataAllList.length
				 	if(pageTwoDataAllList.length){
				 		for(var i=0;i<pageTwoDataAllList.length;i++){
				 			projSubjectStr+=`Discuss_edit.EDITTYPE-${i}:`+pageTwoDataAllList[i].leixing+';'+`Discuss_edit.DATAKEY-${i}:`+pageTwoDataAllList[i].datakey+';'
				 			+`Discuss_edit.PROJ_ID-${i}:`+pageTwoDataAllList[i].proid+';'+`Discuss_edit.DISCUSS_DATE-${i}:`+pageTwoDataAllList[i].DISCUSS_DATE+';'
				 			+`Discuss_edit.PLACE-${i}:`+pageTwoDataAllList[i].PLACE+';'+`Discuss_edit.INVEST_MEMBER-${i}:`+pageTwoDataAllList[i].INVEST_MEMBER+';'
				 			+`Discuss_edit.TEAM_MEMBER-${i}:`+pageTwoDataAllList[i].TEAM_MEMBER+';'+`Discuss_edit.CONTENT-${i}:`+pageTwoDataAllList[i].CONTENT+';'
							+`Discuss_edit.fj-${i}:`+' '+';'
				 		}
				 		projSubjectListData=this.changeStr(projSubjectStr)
				 	}
				 }
				this.sendListData.DATAKEY=this.code
				this.sendListData.PROJ_STAGE=this.pageData.model.PROJ_STAGE
				this.sendListData.SITE_LONG=''
				this.sendListData.SITE_LAT=''
				this.sendListData.SITE_TYPE=pageThreeData.SITE_TYPE
				this.sendListData.SITE_RATIO=pageThreeData.SITE_RATIO
				this.sendListData.SITE_AREA=pageThreeData.SITE_AREA
				this.sendListData.SITE_PRICE=pageThreeData.SITE_PRICE
				this.sendListData.SITE_DESCR=pageThreeData.SITE_DESCR
				this.sendListData.SITE_ADDRESS=pageThreeData.SITE_ADDRESS
			
				this.sendListData.isadding=false					//表单标记，true新增表单，false修改表单
				this.sendListData.submit= 1		//是否提交，1为提交
	
				uni.showLoading()
				const res = await this.$req({
					url:'wxbus/proj/discuss/save.do',
					method:'POST',
					data:{...this.sendListData,...projSubjectListData}
				})
				uni.hideLoading()
				if(res.data.success){
					uni.showToast({
						title:'编辑成功',
						icon:'none'
					})
					//刷新详情和列表
					uni.$emit("refreshDetailData", {});
					uni.$emit("refreshDataList", {})
					if(this.goBack){
						uni.navigateBack()
					}else{
						this.goPages(this.pageList[this.prostage])
					}
				}else{
					uni.showToast({
						title:res.data.messages[0].content,
						icon:'none'
					})
				}
			},
			
			async handleSaveThree(){
				this.sendListData={}
				let projSubjectListData={}
				let pageTwoData=this.$refs.childPageSeve.sendDataList
				let pageOneFilesData=this.$refs.childPageSeve.getFiles //文件参数
				let pageTwoDataDelete=this.$refs.childPageSeve.deleteList //删除的列表
				if(this.pageData.model.CURR_PROJ_STAGE>4&&this.savelog==='Y'){
					this.sendListData.savelog='Y'
				}
				if(pageTwoData){
				 	let projSubjectStr=''
				 	let pageTwoDataAllList=[]
				 	pageTwoDataAllList=pageTwoDataDelete.concat(pageTwoData)
				 	this.sendListData['bus_check_edit.totalNum']=pageTwoDataAllList.length
				 	if(pageTwoDataAllList.length){
				 		for(var i=0;i<pageTwoDataAllList.length;i++){
				 			projSubjectStr+=`bus_check_edit.EDITTYPE-${i}:`+pageTwoDataAllList[i].leixing+';'+`bus_check_edit.DATAKEY-${i}:`+pageTwoDataAllList[i].datakey+';'
				 			+`bus_check_edit.PROJ_ID-${i}:`+pageTwoDataAllList[i].proid+';'+`bus_check_edit.CHECK_DATE-${i}:`+pageTwoDataAllList[i].CHECK_DATE+';'
				 			+`bus_check_edit.OPINION-${i}:`+pageTwoDataAllList[i].OPINION+';'+`bus_check_edit.MEMBER-${i}:`+pageTwoDataAllList[i].MEMBER+';'
				 			+`bus_check_edit.REMARK-${i}:`+pageTwoDataAllList[i].REMARK+';'+`bus_check_edit.xmfxbgxz-${i}:`+' '+';'
							+`bus_check_edit.xmfxbg-${i}:`+' '+';'
				 		}
				 		projSubjectListData=this.changeStr(projSubjectStr)
				 	}
				 }
				this.sendListData.DATAKEY=this.code
				this.sendListData.PROJ_STAGE=this.pageData.model.PROJ_STAGE
				this.sendListData.isadding=false					//表单标记，true新增表单，false修改表单
				this.sendListData.submit= 1		//是否提交，1为提交
				uni.showLoading()
				const res = await this.$req({
					url:'wxbus/proj/check/save.do',
					method:'POST',
					data:{...this.sendListData,...projSubjectListData}
				})
				uni.hideLoading()
				if(res.data.success){
					uni.showToast({
						title:'编辑成功',
						icon:'none'
					})
					//刷新详情和列表
					uni.$emit("refreshDetailData", {});
					uni.$emit("refreshDataList", {})
					if(this.goBack){
						uni.navigateBack()
					}else{
						this.goPages(this.pageList[this.prostage])
					}
				}else{
					uni.showToast({
						title:res.data.messages[0].content,
						icon:'none'
					})
				}
			},
			async handleSaveFour(){
				this.sendListData={}
				let projSubjectListData={}
				let pageTwoData=this.$refs.childPageEight.sendDataList
				let pageOneFilesData=this.$refs.childPageEight.getFiles //文件参数
				let pageTwoDataDelete=this.$refs.childPageEight.deleteList //删除的列表
				if(this.pageData.model.CURR_PROJ_STAGE>4&&this.savelog==='Y'){
					this.sendListData.savelog='Y'
				}
				if(pageTwoData){
				 	let projSubjectStr=''
				 	let pageTwoDataAllList=[]
				 	pageTwoDataAllList=pageTwoDataDelete.concat(pageTwoData)
				 	this.sendListData['bus_eval_edit.totalNum']=pageTwoDataAllList.length
				 	if(pageTwoDataAllList.length){
				 		for(var i=0;i<pageTwoDataAllList.length;i++){
				 			projSubjectStr+=`bus_eval_edit.EDITTYPE-${i}:`+pageTwoDataAllList[i].leixing+';'+`bus_eval_edit.DATAKEY-${i}:`+pageTwoDataAllList[i].datakey+';'
				 			+`bus_eval_edit.PROJ_ID-${i}:`+pageTwoDataAllList[i].proid+';'+`bus_eval_edit.EVALUATE_DATE-${i}:`+pageTwoDataAllList[i].EVALUATE_DATE+';'
				 			+`bus_eval_edit.OPINION-${i}:`+pageTwoDataAllList[i].OPINION+';'+`bus_eval_edit.MEMBER-${i}:`+pageTwoDataAllList[i].MEMBER+';'
				 			+`bus_eval_edit.REMARK-${i}:`+pageTwoDataAllList[i].REMARK+';'+`bus_eval_edit.STATUS-${i}:`+pageTwoDataAllList[i].STATUS+';'
							+`bus_eval_edit.pgfj-${i}:`+' '+';'+`bus_eval_edit.pgfjxg-${i}:`+' '+';'
				 		}
				 		projSubjectListData=this.changeStr(projSubjectStr)
						console.log(projSubjectListData,"projSubjectListDataprojSubjectListData")
				 	}
				 }
				this.sendListData.DATAKEY=this.code
				this.sendListData.PROJ_STAGE=this.pageData.model.PROJ_STAGE
				this.sendListData.isadding=false					//表单标记，true新增表单，false修改表单
				this.sendListData.submit= 1		//是否提交，1为提交
				uni.showLoading()
				const res = await this.$req({
					url:'wxbus/proj/eval/save.do',
					method:'POST',
					data:{...this.sendListData,...projSubjectListData}
				})
				uni.hideLoading()
				if(res.data.success){
					uni.showToast({
						title:'编辑成功',
						icon:'none'
					})
					//刷新详情和列表
					uni.$emit("refreshDetailData", {});
					uni.$emit("refreshDataList", {})
					if(this.goBack){
						uni.navigateBack()
					}else{
						this.goPages(this.pageList[this.prostage])
					}
				}else{
					uni.showToast({
						title:res.data.messages[0].content,
						icon:'none'
					})
				}
			},
			async handleSaveFive(){
				this.sendListData={}
				let pageOneFileList=this.$refs.childPageNine.newFileList //文件
				this.sendListData.DATAKEY=this.dataKey
				if(pageOneFileList&&pageOneFileList.length){
					this.sendListData.newAttachId=pageOneFileList[0].dataKey
				}
				if(this.pageData.model.CURR_PROJ_STAGE>4&&this.savelog==='Y'){
					this.sendListData.savelog='Y'
				}
				this.sendListData.isadding=false					//表单标记，true新增表单，false修改表单
				this.sendListData.submit= 1		//是否提交，1为提交
				uni.showLoading()
				const res = await this.$req({
					url:'wxbus/proj/negotiate/save.do',
					method:'POST',
					data:{...this.sendListData}
				})
				uni.hideLoading()
				if(res.data.success){
					uni.showToast({
						title:'编辑成功',
						icon:'none'
					})
					//刷新详情和列表
					uni.$emit("refreshDetailData", {});
					uni.$emit("refreshDataList", {})
					if(this.goBack){
						uni.navigateBack()
					}else{
						this.goPages(this.pageList[this.prostage])
					}
				}else{
					uni.showToast({
						title:res.data.messages[0].content,
						icon:'none'
					})
				}
			},
			async handleSaveSix(){
				this.sendListData={}
				let pageOneData=this.$refs.childSevenOne.formData
				let pageTwoData=this.$refs.childSevenOne.getFiles //文件参数
				let pageThreeData=this.$refs.childSevenTwo.formData
				if(this.pageData.model.CURR_PROJ_STAGE>4&&this.savelog==='Y'){
					this.sendListData.savelog='Y'
				}
				this.sendListData['PPP_T_BUS_PROJ.ZJHTFJ']=''
				this.sendListData.DATAKEY=this.dataKey
				this.sendListData.PROJ_ID=pageOneData.PROJ_ID
				this.sendListData.SIGN_TIME=pageOneData.SIGN_TIME
				this.sendListData.REAL_INVEST=pageOneData.REAL_INVEST
				this.sendListData.REGISTERED_CAPITAL=pageOneData.REGISTERED_CAPITAL
				this.sendListData.FIXED_ASSETS=pageOneData.FIXED_ASSETS
				this.sendListData.REAL_SITE_AREA=pageOneData.REAL_SITE_AREA
				this.sendListData.SITE_PREPARE_DEADLINE=pageOneData.SITE_PREPARE_DEADLINE
				this.sendListData.SITE_YEAR=pageOneData.SITE_YEAR
				this.sendListData.COMPANY_REG_DEADLINE=pageOneData.COMPANY_REG_DEADLINE
				this.sendListData.BUILD_FINISH_DEADLINE=pageOneData.BUILD_FINISH_DEADLINE
				this.sendListData.PRODUCE_DEADLINE=pageOneData.PRODUCE_DEADLINE
				this.sendListData.REAL_TAX=pageOneData.REAL_TAX
				this.sendListData.REMARK=pageOneData.REMARK
				this.sendListData.ORG=pageThreeData.ORG
				this.sendListData.SIGN_TIME_ORG=pageThreeData.SIGN_TIME_ORG
				this.sendListData.CONTRACT_CODE_ORG=pageThreeData.CONTRACT_CODE_ORG
				this.sendListData.REMARK_ORG=pageThreeData.REMARK_ORG
				this.sendListData.isadding=false					//表单标记，true新增表单，false修改表单
				this.sendListData.submit= 1		//是否提交，1为提交
				uni.showLoading()
				const res = await this.$req({
					url:'wxbus/proj/contract/save.do',
					method:'POST',
					data:{...this.sendListData}
				})
				uni.hideLoading()
				if(res.data.success){
					uni.showToast({
						title:'编辑成功',
						icon:'none'
					})
					//刷新详情和列表
					uni.$emit("refreshDetailData", {});
					uni.$emit("refreshDataList", {})
					if(this.goBack){
						uni.navigateBack()
					}else{
						this.goPages(this.pageList[this.prostage])
					}
				}else{
					uni.showToast({
						title:res.data.messages[0].content,
						icon:'none'
					})
				}
			},
			
			async handleSaveSeven(){
				this.sendListData={}
				let pageOneData=this.$refs.childSeven.formData
				let pageTwoData=this.$refs.childSeven.getFiles //文件参数
				if(this.pageData.model.CURR_PROJ_STAGE>4&&this.savelog==='Y'){
					this.sendListData.savelog='Y'
				}
				this.sendListData['PPP_T_BUS_PROJ.GSDJFJ']=''
				this.sendListData.DATAKEY=this.dataKey
				this.sendListData.PROJ_ID=pageOneData.PROJ_ID
				this.sendListData.MANAGER=pageOneData.MANAGER
				this.sendListData.NAME=pageOneData.NAME
				this.sendListData.FUND=pageOneData.FUND
				this.sendListData.ACCOUNT=pageOneData.ACCOUNT
				this.sendListData.BUSS_REGISTER=pageOneData.BUSS_REGISTER
				this.sendListData.TAX_REGISTER=pageOneData.TAX_REGISTER
				this.sendListData.REMARK=pageOneData.REMARK
				this.sendListData.isadding=false					//表单标记，true新增表单，false修改表单
				this.sendListData.submit= 1		//是否提交，1为提交
				uni.showLoading()
				const res = await this.$req({
					url:'bus/proj/company/save.do',
					method:'POST',
					data:{...this.sendListData}
				})
				uni.hideLoading()
				if(res.data.success){
					uni.showToast({
						title:'编辑成功',
						icon:'none'
					})
					//刷新详情和列表
					uni.$emit("refreshDetailData", {});
					uni.$emit("refreshDataList", {})
					if(this.goBack){
						uni.navigateBack()
					}else{
						this.goPages(this.pageList[this.prostage])
					}
				}else{
					uni.showToast({
						title:res.data.messages[0].content,
						icon:'none'
					})
				}
			},
			
			async handleSaveEight(){
				this.sendListData={}
				let pageOneData=this.$refs.childEight.formData
				let pageTwoData=this.$refs.childEight.getListData //文件参数
				if(this.pageData.model.CURR_PROJ_STAGE>4&&this.savelog==='Y'){
					this.sendListData.savelog='Y'
				}
				this.sendListData['PPP_T_BUS_SITE_SUPPLY.BZJCL']= ''
				this.sendListData['PPP_T_BUS_SITE_SUPPLY.YDHXCL']= ''
				this.sendListData['PPP_T_BUS_SITE_SUPPLY.SDBZCL']= ''
				this.sendListData['PPP_T_BUS_SITE_SUPPLY.TDKJFCL']= ''
				this.sendListData['PPP_T_BUS_SITE_SUPPLY.OTHER']=''
				this.sendListData.DATAKEY=this.code
				this.sendListData.PROJ_ID=pageOneData.PROJ_ID
				this.sendListData.BZJ_DATE=pageOneData.BZJ_DATE
				this.sendListData.BZJ_REMARK=pageOneData.BZJ_REMARK
				this.sendListData.YDHX_DATE=pageOneData.YDHX_DATE
				this.sendListData.YDHX_REMARK=pageOneData.YDHX_REMARK
				this.sendListData.TDKJF_DATE=pageOneData.TDKJF_DATE
				this.sendListData.TDKJF_REMARK=pageOneData.TDKJF_REMARK
				this.sendListData.OTHER_DATE=pageOneData.OTHER_DATE
				this.sendListData.OTHER_REMARK=pageOneData.OTHER_REMARK
				this.sendListData.isadding=false					//表单标记，true新增表单，false修改表单
				this.sendListData.submit= 1		//是否提交，1为提交
				uni.showLoading()
				const res = await this.$req({
					url:'wxbus/proj/supply/save.do',
					method:'POST',
					data:{...this.sendListData}
				})
				uni.hideLoading()
				if(res.data.success){
					uni.showToast({
						title:'编辑成功',
						icon:'none'
					})
					//刷新详情和列表
					uni.$emit("refreshDetailData", {});
					uni.$emit("refreshDataList", {})
					if(this.goBack){
						uni.navigateBack()
					}else{
						this.goPages(this.pageList[this.prostage])
					}
				}else{
					uni.showToast({
						title:res.data.messages[0].content,
						icon:'none'
					})
				}
			},
			
			async handleSaveNine(){
				this.sendListData={}
				let pageOneData=this.$refs.childNine.formData
				if(this.pageData.model.CURR_PROJ_STAGE>4&&this.savelog==='Y'){
					this.sendListData.savelog='Y'
				}
				this.sendListData.DATAKEY=this.code
				this.sendListData.PROJ_ID=pageOneData.PROJ_ID
				this.sendListData.APPROVE=pageOneData.APPROVE
				this.sendListData.APPROVE_DATE=pageOneData.APPROVE_DATE
				this.sendListData.DESIGN_MATERIAL=pageOneData.DESIGN_MATERIAL
				this.sendListData.DESIGN_MATERIAL_DATE=pageOneData.DESIGN_MATERIAL_DATE
				this.sendListData.CONSTRUCT_DESIGN=pageOneData.CONSTRUCT_DESIGN
				this.sendListData.CONSTRUCT_DESIGN_DATE=pageOneData.CONSTRUCT_DESIGN_DATE
				this.sendListData.SITE_FILE=pageOneData.SITE_FILE
				this.sendListData.SITE_FILE_DATE=pageOneData.SITE_FILE_DATE
				this.sendListData.PLANNING_LICENSE=pageOneData.PLANNING_LICENSE
				this.sendListData.PLANNING_LICENSE_DATE=pageOneData.PLANNING_LICENSE_DATE
				this.sendListData.START_CHECK=pageOneData.START_CHECK
				this.sendListData.START_CHECK_DATE=pageOneData.START_CHECK_DATE
				this.sendListData.FINISH_CHECK=pageOneData.FINISH_CHECK
				this.sendListData.FINISH_CHECK_DATE=pageOneData.FINISH_CHECK_DATE
				this.sendListData.OTHER=pageOneData.OTHER
				this.sendListData.OTHER_DATE=pageOneData.OTHER_DATE
				this.sendListData.isadding=false					//表单标记，true新增表单，false修改表单
				this.sendListData.submit= 1		//是否提交，1为提交
				uni.showLoading()
				const res = await this.$req({
					url:'wxbus/proj/build/save.do',
					method:'POST',
					data:{...this.sendListData}
				})
				uni.hideLoading()
				if(res.data.success){
					uni.showToast({
						title:'编辑成功',
						icon:'none'
					})
					//刷新详情和列表
					uni.$emit("refreshDetailData", {});
					uni.$emit("refreshDataList", {})
					if(this.goBack){
						uni.navigateBack()
					}else{
						this.goPages(this.pageList[this.prostage])
					}
				}else{
					uni.showToast({
						title:res.data.messages[0].content,
						icon:'none'
					})
				}
			},
			
			async handleSaveTen(){
				this.sendListData={}
				let pageOnefileList=this.$refs.childTenone.newFileList //文件
				let pageOneData=this.$refs.childTenone.sendData  //列表
				if(pageOnefileList&&pageOnefileList.length){
					this.sendListData.newAttachId=pageOnefileList[0].dataKey
				}
				let pageTwoShowList1=this.$refs.childTentwo.showList1 //展示的列表
				let pageTwoDataDelete1=this.$refs.childTentwo.deleteList1 //删除的列表
				let projSubjectListData1={}
				if(pageTwoShowList1.length){
				 	let projSubjectStr1=''
				 	let pageTwoDataAllList1=[]
				 	pageTwoDataAllList1=pageTwoDataDelete1.concat(pageTwoShowList1)
				 	this.sendListData['Sale_edit.totalNum']=pageTwoDataAllList1.length
				 	if(pageTwoDataAllList1.length){
				 		for(var i=0;i<pageTwoDataAllList1.length;i++){
				 			projSubjectStr1+=`Sale_edit.EDITTYPE-${i}:`+pageTwoDataAllList1[i].leixing+';'+`Sale_edit.DATAKEY-${i}:`+pageTwoDataAllList1[i].datakey+';'
				 			+`Sale_edit.PROJ_ID-${i}:`+pageTwoDataAllList1[i].proid+';'+`Sale_edit.MONTH-${i}:`+pageTwoDataAllList1[i].MONTH+';'
				 			+`Sale_edit.MONTH_SALE-${i}:`+pageTwoDataAllList1[i].MONTH_SALE+';'
				 		}
				 		projSubjectListData1=this.changeStr(projSubjectStr1)
				 	}
				}
				
				let pageTwoShowList2=this.$refs.childTentwo.showList2 //展示的列表
				let pageTwoDataDelete2=this.$refs.childTentwo.deleteList2 //删除的列表reeeeeeeee
				let projSubjectListData2={}
				if(pageTwoShowList2.length){
				 	let projSubjectStr2=''
				 	let pageTwoDataAllList2=[]
				 	pageTwoDataAllList2=pageTwoDataDelete2.concat(pageTwoShowList2)
				 	this.sendListData['Income_edit.totalNum']=pageTwoDataAllList2.length
				 	if(pageTwoDataAllList2.length){
				 		for(var i=0;i<pageTwoDataAllList2.length;i++){
				 			projSubjectStr2+=`Income_edit.EDITTYPE-${i}:`+pageTwoDataAllList2[i].leixing+';'+`Income_edit.DATAKEY-${i}:`+pageTwoDataAllList2[i].datakey+';'
				 			+`Income_edit.PROJ_ID-${i}:`+pageTwoDataAllList2[i].proid+';'+`Income_edit.MONTH-${i}:`+pageTwoDataAllList2[i].MONTH+';'
				 			+`Income_edit.MONTH_INCOME-${i}:`+pageTwoDataAllList2[i].MONTH_INCOME+';'
				 		}
				 		projSubjectListData2=this.changeStr(projSubjectStr2)
				 	}
				}
				
				let pageTwoShowList3=this.$refs.childTentwo.showList3 //展示的列表
				let pageTwoDataDelete3=this.$refs.childTentwo.deleteList3 //删除的列表
				let projSubjectListData3={}
				if(pageTwoShowList3.length){
				 	let projSubjectStr3=''
				 	let pageTwoDataAllList3=[]
				 	pageTwoDataAllList3=pageTwoDataDelete3.concat(pageTwoShowList3)
				 	this.sendListData['busTax_edit.totalNum']=pageTwoDataAllList3.length
				 	if(pageTwoDataAllList3.length){
				 		for(var i=0;i<pageTwoDataAllList3.length;i++){
				 			projSubjectStr3+=`busTax_edit.EDITTYPE-${i}:`+pageTwoDataAllList3[i].leixing+';'+`busTax_edit.DATAKEY-${i}:`+pageTwoDataAllList3[i].datakey+';'
				 			+`busTax_edit.PROJ_ID-${i}:`+pageTwoDataAllList3[i].proid+';'+`busTax_edit.MONTH-${i}:`+pageTwoDataAllList3[i].MONTH+';'
				 			+`busTax_edit.MONTH_INCOME-${i}:`+pageTwoDataAllList3[i].MONTH_INCOME+';'
				 		}
				 		projSubjectListData3=this.changeStr(projSubjectStr3)
				 	}
				}
				
				let pageTwoShowList4=this.$refs.childTentwo.showList4 //展示的列表
				let pageTwoDataDelete4=this.$refs.childTentwo.deleteList4 //删除的列表
				let projSubjectListData4={}
				if(pageTwoShowList4.length){
				 	let projSubjectStr4=''
				 	let pageTwoDataAllList4=[]
				 	pageTwoDataAllList4=pageTwoDataDelete4.concat(pageTwoShowList4)
				 	this.sendListData['Service_edit.totalNum']=pageTwoDataAllList4.length
				 	if(pageTwoDataAllList4.length){
				 		for(var i=0;i<pageTwoDataAllList4.length;i++){
				 			projSubjectStr4+=`Service_edit.EDITTYPE-${i}:`+pageTwoDataAllList4[i].leixing+';'+`Service_edit.DATAKEY-${i}:`+pageTwoDataAllList4[i].datakey+';'
				 			+`Service_edit.PROJ_ID-${i}:`+pageTwoDataAllList4[i].proid+';'+`Service_edit.CATEGORY-${i}:`+pageTwoDataAllList4[i].CATEGORY+';'
				 			+`Service_edit.CONTENT-${i}:`+pageTwoDataAllList4[i].CONTENT+';'
							+`Service_edit.FINISH_DATE-${i}:`+pageTwoDataAllList4[i].FINISH_DATE+';'+`Service_edit.REQUIRE-${i}:`+pageTwoDataAllList4[i].REQUIRE+';'
							+`Service_edit.SERVICE_DATE-${i}:`+pageTwoDataAllList4[i].SERVICE_DATE+';'
				 		}
				 		projSubjectListData4=this.changeStr(projSubjectStr4)
				 	}
				}
				
				let pageTwoShowList5=this.$refs.childTentwo.showList5 //展示的列表
				let pageTwoDataDelete5=this.$refs.childTentwo.deleteList5 //删除的列表
				let projSubjectListData5={}
				if(pageTwoShowList5.length){
				 	let projSubjectStr5=''
				 	let pageTwoDataAllList5=[]
				 	pageTwoDataAllList5=pageTwoDataDelete5.concat(pageTwoShowList5)
				 	// this.sendListData['Policy_edit.totalNum']=pageTwoDataAllList5.length
				 	if(pageTwoDataAllList5.length){
				 		for(var i=0;i<pageTwoDataAllList5.length;i++){
				 			projSubjectStr5+=`Policy_edit.EDITTYPE-${i}:`+pageTwoDataAllList5[i].leixing+';'+`Policy_edit.DATAKEY-${i}:`+pageTwoDataAllList5[i].datakey+';'
				 			+`Policy_edit.PROJ_ID-${i}:`+pageTwoDataAllList5[i].proid+';'+`Policy_edit.CATEGORY-${i}:`+pageTwoDataAllList5[i].CATEGORY+';'
				 			+`Policy_edit.MONEY-${i}:`+pageTwoDataAllList5[i].MONEY+';'+`Policy_edit.POLICY_DATE-${i}:`+pageTwoDataAllList5[i].POLICY_DATE+';'
							+`Policy_edit.REMARK-${i}:`+pageTwoDataAllList5[i].REMARK+';'
							
				 		}
				 		projSubjectListData5=this.changeStr(projSubjectStr5)
				 	}
				}
				
				
				let pageThreeData=this.$refs.childTenthe.sendData  //列表
				let pageThreeShowList=this.$refs.childTenthe.showList //展示的列表		
				if(this.pageData.model.CURR_PROJ_STAGE>4&&this.savelog==='Y'){
					this.sendListData.savelog='Y'
				}
			
				this.sendListData.DATAKEY=this.code
				this.sendListData.CURR_PROJ_STAGE=10
				this.sendListData.PROJ_STAGE=10
				this.sendListData.isadding=false					//表单标记，true新增表单，false修改表单
				this.sendListData.submit= 1		//是否提交，1为提交
				uni.showLoading()
				const res = await this.$req({
					url:'wxbus/proj/track/save.do',
					method:'POST',
					data:{...this.sendListData,...pageOneData,...projSubjectListData1,...projSubjectListData2,...projSubjectListData3,...projSubjectListData4,...projSubjectListData5,...pageThreeData}
				})
				uni.hideLoading()
				if(res.data.success){
					uni.showToast({
						title:'编辑成功',
						icon:'none'
					})
					//刷新详情和列表
					uni.$emit("refreshDetailData", {});
					uni.$emit("refreshDataList", {})
					if(this.goBack){
						uni.navigateBack()
					}else{
						this.goPages(this.pageList[this.prostage])
					}
				}else{
					uni.showToast({
						title:res.data.messages[0].content,
						icon:'none'
					})
				}
			},
			handleNext(){
				this.goBack=false
				this.handleSave()
			},
			
			changeStr(str){
				let ArryObj={}
				if(str){
					const arryOne=str.split(";")
					arryOne.map(item=>{
						if(item.split(":")[0]){
							ArryObj[item.split(":")[0]]=item.split(":")[1]
						}
						
					})
					for(var i in ArryObj){
						if(ArryObj[i]==="null"){
							ArryObj[i]=null
						}
					}
					return ArryObj
				}
				
			},
			//tab切换
			onNavBarChange(current){
				if(this.navCurrent === current){
					return;
				}
				this.navCurrent = current;
				this.refreshList();
			},
			goPages(item){
				this.goBack=true
				this.pageThis=item.pageid
				let goPageUrl=''
				if(item.pageid>this.project){
					return uni.showToast({
						title:'项目还未进行到该阶段',
						icon:'none'
					})
				}
				this.initShow()
				uni.setNavigationBarTitle({
					title: item.title
				})
				if(item.pageid===1){
					this.showPage.show1=true
					this.showTabbar=true
					goPageUrl='bus/proj/view.do'
					this.navs=[
						{name: '项目信息'},
						{name: '主体信息'},
						{name: '跟进团队'}
					]
					this.toDetailData(goPageUrl,item.pageid)
				}else if(item.pageid===2){
					this.showPage.show2=true
					this.showTabbar=true
					goPageUrl='bus/proj/discuss/view.do'
					this.navs=[
						{name: '评估材料'},
						{name: '洽谈信息'},
						{name: '用地信息'},
					]
					this.toDetailData(goPageUrl,item.pageid)
				}else if(item.pageid===3){
					this.showPage.show3=true
					goPageUrl='bus/proj/check/view.do'
					this.navs=[
						{name: '项目核查'}
					]
					this.toDetailData(goPageUrl,item.pageid)
				}else if(item.pageid===4){
					//notab
					this.showPage.show4=true
					goPageUrl='bus/proj/eval/view.do'
					this.navs=[
						{name: '项目再评估'}
					]
					this.toDetailData(goPageUrl,item.pageid)
				}else if(item.pageid===5){
					//notab
					this.showPage.show5=true
					goPageUrl='bus/proj/negotiate/view.do'
					this.navs=[
						{name: '商务谈判'}
					]
					this.toDetailData(goPageUrl,item.pageid)
				}else if(item.pageid===6){
					this.showPage.show6=true
					this.showTabbar=true
					goPageUrl='bus/proj/contract/getDataKey.do'
					this.navs=[
						{name: '项目合同'},
						{name: '中介机构合同'}
					]
					this.getProData(goPageUrl,item.pageid)
				}else if(item.pageid===7){
					//notab
					this.showPage.show7=true
					goPageUrl='bus/proj/company/getDataKey.do'
					this.navs=[
						{name: '公司登记'}
					]
					this.getProData(goPageUrl,item.pageid)
				}else if(item.pageid===8){
					//notab
					this.showPage.show8=true
					goPageUrl='bus/proj/supply/getDataKey.do'
					this.navs=[
						{name: '项目供地'}
					]
					this.getProData(goPageUrl,item.pageid)
				}else if(item.pageid===9){
					this.showPage.show9=true
					goPageUrl='bus/proj/build/getDataKey.do'
					this.navs=[
						{name: '项目建设'}
					]
					this.getProData(goPageUrl,item.pageid)
				}else if(item.pageid===10){
					this.showPage.show10=true
					this.showTabbar=true
					goPageUrl='bus/proj/track/view.do'
					this.navs=[
						{name: '项目信息'},
						{name: '列表信息'},
						{name: '收入统计'}
					]
					this.toDetailData(goPageUrl,item.pageid)
				}else{
					uni.showToast({
						title:'项目还未进行到该阶段',
						icon:'none'
					})
				}
			},
			async toDetailData(url,itId){
				this.prostage=itId
				uni.showLoading()
				const res = await this.$req({
					url:url,
					method:'GET',
					data:{
						dataKey:this.code	
					}
				})
				uni.hideLoading()
				if(res.data.success){
					this.pageData=res.data.attributes
					//跟进负责人
					if(res.data.attributes.zdyDataSource.personDataSourceManage){
						this.renmingData = res.data.attributes.zdyDataSource.personDataSourceManage
						this.renmingData.map(item=>{
							if(item.CODE===this.pageData.model.MANAGER){
								this.pageData.genjinren=item.CODE_NAME
							}
						})
					}
					//主体名称
					if(res.data.attributes.zdyDataSource.busInvestorDataSourceManage){
						this.zhutiData=res.data.attributes.zdyDataSource.busInvestorDataSourceManage
					}
					//中介机构名称
					if(res.data.attributes.zdyDataSource.busOrganizationDataSourceManage){
						this.zhongjieData=res.data.attributes.zdyDataSource.busOrganizationDataSourceManage
						if(this.pageData.model.ORGANIZATION){
							this.zhongjieData.map(item=>{
								if(item.CODE===this.pageData.model.ORGANIZATION){
									this.pageData.zhongjieName=item.CODE_NAME
								}
							})
						}
						if(this.pageData.model.ORG){
							this.zhongjieData.map(item=>{
								if(item.CODE===this.pageData.model.ORG){
									this.pageData.ORG_value=item.CODE_NAME
								}
							})
						}
					}
					const  dicData = JSON.parse(uni.getStorageSync('dicData')) 
					//行业类别
					this.pageData.hangye = this.$util.queryDicName(dicData,'inve_field',this.pageData.model.INDUSTRY);
					//項目來源
					this.pageData.laiyuan = this.$util.queryDicName(dicData,'busProjSource',this.pageData.model.SOURCE);
					//核心诉求
					if(this.pageData.model.PROJ_APPEAL){
						let newbackArry=[]
						const backArry=this.pageData.model.PROJ_APPEAL.split(",")
						backArry.map(item=>{
							newbackArry.push(this.$util.queryDicName(dicData,'PROJ_APPEAL',item));
						})
						this.pageData.suqiu=newbackArry.join(",")
					}
					
					//获取用地方式参数
					this.pageData.yongdifangshi=this.$util.queryDicName(dicData,'busProjSiteMethod',this.pageData.model.SITE_TYPE);
									
					//第2页
					if(itId===2){
						//获取文件名
						const fileArry=Object.values(this.pageData.docJsonData)
						if(this.pageData.dataGrid['Discuss_view'].datas){
							this.pageData.dataGrid['Discuss_view'].datas.map(item=>{
								if(item.DATAKEY){
									fileArry.map(ites=>{
										if(JSON.parse(JSON.stringify(ites))["modelId"]){
											if(JSON.parse(JSON.stringify(ites))["modelId"]===item.DATAKEY){
												if(JSON.parse(JSON.stringify(ites)).fileList.length>0){
													item.file=JSON.parse(JSON.stringify(ites)).fileList
												}else{
													item.file=[]
												}
											}
										}
									})
								}
								if(item.TEAM_MEMBER){				
									item.MEMBER_NAME=this.codeToName(item.TEAM_MEMBER)
					
								}
							})
						}
					}
					//第3页
					if(itId===3){
						if(this.pageData.dataGrid['bus_check_view'].datas){
							this.pageData.dataGrid['bus_check_view'].datas.map(item=>{
								if(item.MEMBER){
									item.MEMBER_NAME=this.codeToName(item.MEMBER)
								}
								if(this.pageData.docJsonData){
									const keysArray=Object.keys(this.pageData.docJsonData)
									keysArray.map(ites=>{
										//项目分析报告附件
										if(ites.indexOf('PPP_T_BUS_CHECK.XMFXBG')!=-1){
											if(ites.indexOf(item.DATAKEY)!=-1){
												item.XMFXBG=this.pageData.docJsonData[ites].fileList
											}	
										}
										//项目分析报告修正附件
										if(ites.indexOf('PPP_T_BUS_CHECK.XMFXBGXZ')!=-1){
											if(ites.indexOf(item.DATAKEY)!=-1){
												item.XMFXBGXZ=this.pageData.docJsonData[ites].fileList
											}	
										}
									})
								}
							})
						}
					}
					//第4页
					if(itId===4){
						if(this.pageData.dataGrid['bus_eval_view'].datas){
							this.pageData.dataGrid['bus_eval_view'].datas.map(item=>{
								if(item.MEMBER){
									item.MEMBER_NAME=this.codeToName(item.MEMBER)
								}
								if(item.STATUS){
									if(item.STATUS===0){
										item.STATUS_NAME='未评估'
									}else if(item.STATUS===1){
										item.STATUS_NAME='评估中'
									}else{
										item.STATUS_NAME='已评估'
									}
									
								}
								if(this.pageData.docJsonData){
									const keysArray=Object.keys(this.pageData.docJsonData)
									keysArray.map(ites=>{
										//项目评估报告附件
										if(ites.indexOf('PPP_T_BUS_EVALUATE.PGFJ')!=-1){
											if(ites.indexOf(item.DATAKEY)!=-1){
												item.PGFJ=this.pageData.docJsonData[ites].fileList
											}
											
										}
										//项目评估报告修正附件
										if(ites.indexOf('PPP_T_BUS_CHECK.PGXGFJ')!=-1){
											if(ites.indexOf(item.DATAKEY)!=-1){
												item.PGXGFJ=this.pageData.docJsonData[ites].fileList
											}
										}
									})
								}
							})
						}
					}
					//获取联系人参数
					const lianxirenList=this.pageData.dataGrid['TeamMember_view']?this.pageData.dataGrid['TeamMember_view'].datas:[]
					if(lianxirenList.length){
						this.renmingData.map(item=>{
							lianxirenList.map(ites=>{
								if(ites.MEMBER){
									if(JSON.parse(JSON.stringify(item))["CODE"]===ites.MEMBER){
										ites.lianxiren =JSON.parse(JSON.stringify(item))["CODE_NAME"]
									}
								}
							})
						})
					}
					//获取主体名称参数
					const zhutiList=this.pageData.dataGrid.proj_subject_view?this.pageData.dataGrid.proj_subject_view.datas:[]
					if(zhutiList.length){
						this.zhutiData.map(item=>{
							zhutiList.map(ites=>{
								if(ites.INVESTOR){
									if(JSON.parse(JSON.stringify(item))["CODE"]===ites.INVESTOR){
										ites.zhuti =JSON.parse(JSON.stringify(item))["CODE_NAME"]
									}
								}
							})
						})
					}
					
					this.changeListData={
						hangyeList:JSON.parse(dicData.inve_field),
						laiyuanList:JSON.parse(dicData.busProjSource),
						suqiuList:JSON.parse(dicData.PROJ_APPEAL),
						DiscountTypeList:JSON.parse(dicData.DiscountType),
						serviceTypeList:JSON.parse(dicData.serviceType),
						zhongjieList:this.zhongjieData,
						zhutiList:this.zhutiData,
						renmingList:this.renmingData,
					}
				} else {
					uni.showToast({
						title:res.data.message,
						icon:'none'
					})
				}	
			},
			refreshList(){},
			//数据字典
			async getDicData(){
				const ret = await this.$api.getDicData();
				this.dicData = {...ret};
			},
			//跟进人转化
			codeToName(str){
				if(str){
					let newArray=[]
					const arrayOne=str.split(',')
					this.personData.map(item=>{
						arrayOne.map(ites=>{
							if(ites===item.CODE){
								newArray.push(item.CODE_NAME)
							}
						})
					})
					return newArray.join('; ')
				}
			},
			async getProData(url,itId){
				uni.showLoading()
				const res  =await this.$req({
					url:url,
					method:'GET',
					data:{
						projId:this.code
					}
				})
				uni.hideLoading()
				if(res.data.attributes){
					let sendUrl=''
					this.dataKey=res.data.attributes.dataKey
					this.prostage=itId
					if(itId===6){
						sendUrl='bus/proj/contract/view.do'
					}else if(itId===7){
						sendUrl='bus/proj/company/view.do'
					}else if(itId===8){
						sendUrl='/bus/proj/supply/view.do'
					}else if(itId===9){
						sendUrl='bus/proj/build/view.do'
					}
					this.getDetailData(sendUrl)
				} else {
					uni.showToast({
						title:res.data.message,
						icon:'none'
					})
				}	
			},
			async getDetailData(url){
				this.pageData=[]
				uni.showLoading()
				const res  =await this.$req({
					url:url,
					method:'GET',
					data:{
						dataKey:this.dataKey,
						projId: this.code
					}
				})
				uni.hideLoading()
				if(res.data.success){
					this.pageData=res.data.attributes
					//跟进负责人
					if(res.data.attributes.zdyDataSource.personDataSourceManage){
						this.renmingData = res.data.attributes.zdyDataSource.personDataSourceManage
					}
					//主体名称
					if(res.data.attributes.zdyDataSource.busInvestorDataSourceManage){
						this.zhutiData=res.data.attributes.zdyDataSource.busInvestorDataSourceManage
					}
					//中介机构名称
					if(res.data.attributes.zdyDataSource.busOrganizationDataSourceManage){
						this.zhongjieData=res.data.attributes.zdyDataSource.busOrganizationDataSourceManage
					}
					//获取跟进负责人参数
					if(this.pageData.model.MANAGER&&this.renmingData){
						this.renmingData.map(item=>{
							if(JSON.parse(JSON.stringify(item))["CODE"]===this.pageData.model.MANAGER){
								this.pageData.genjinren=JSON.parse(JSON.stringify(item))["CODE_NAME"]
							}
						})
					}
					//获取中介机构参数
					if(this.pageData.model.ORG&&this.zhongjieData){
						this.zhongjieData.map(item=>{
							if(JSON.parse(JSON.stringify(item))["CODE"]===this.pageData.model.ORG){
								this.pageData.ORG_value=JSON.parse(JSON.stringify(item))["CODE_NAME"]
							}
						})
					}
					const  dicData = JSON.parse(uni.getStorageSync('dicData'))
					//行业类别
					this.pageData.hangye = this.$util.queryDicName(dicData,'inve_field',this.pageData.model.INDUSTRY);
					//項目來源
					this.pageData.laiyuan = this.$util.queryDicName(dicData,'busProjSource',this.pageData.model.SOURCE);
					//核心诉求
					if(this.pageData.model.PROJ_APPEAL){
						let newbackArry=[]
						const backArry=this.pageData.model.PROJ_APPEAL.split(",")
						backArry.map(item=>{
							newbackArry.push(this.$util.queryDicName(dicData,'PROJ_APPEAL',item));
						})
						this.pageData.suqiu=newbackArry.join(",")
					}
					
					//获取用地方式参数
					this.pageData.yongdifangshi=this.$util.queryDicName(dicData,'busProjSiteMethod',this.pageData.model.SITE_TYPE);
					this.changeListData={
						hangyeList:JSON.parse(dicData.inve_field),
						laiyuanList:JSON.parse(dicData.busProjSource),
						suqiuList:JSON.parse(dicData.PROJ_APPEAL),
						laiyuanList:JSON.parse(dicData.busProjSource),
						zhongjieList:this.zhongjieData,
						zhutiList:this.zhutiData,
						renmingList:this.renmingData
					}
				} else {
					uni.showToast({
						title:res.data.messages[0].content,
						icon:'none'
					})
				}	
			},
			//跟进人
			async getFlPerson(){
				const ret = await this.$req({
					url:'bus/proj/filter.do',
					data:{moduleId: 'busProj'}
				})
				if(ret.data.success){
					this.personData = ret.data.attributes.zdyDataSource.personDataSourceManage
				}
			},
			getIndexes(data){
				if(data){
					this.pageForIndex=data.index
					this.pageForData=data.dataList
					this.itemPageIndex=data.num
				}
				
			},
		},
		onLoad(options) {
			this.getFlPerson()
			console.log(options,"options参数为")
			this.code = options.code
			this.project=options.project*1
			this.prostage=options.prostage
			this.goPages(this.pageList[options.prostage-1])
		},
		onShow() {
			uni.$on("person", res => {
				console.log('onshow', res);
				// 清除监听
				if(this.pageForData.length){
					if(this.itemPageIndex===5){
						this.pageForData[this.pageForIndex].TEAM_MEMBER=res.data.map(item => {
							return item.value
						}).join(',')
						this.pageForData[this.pageForIndex].MEMBER_NAME=res.data.map(item => {
							return item.text
						}).join(',')
					}else if(this.itemPageIndex===7){
						this.pageForData[this.pageForIndex].MEMBER=res.data.map(item => {
							return item.value
						}).join(',')
						this.pageForData[this.pageForIndex].MEMBER_NAME=res.data.map(item => {
							return item.text
						}).join(',')
					}else if(this.itemPageIndex===8){
						this.pageForData[this.pageForIndex].MEMBER=res.data.map(item => {
							return item.value
						}).join(',')
						this.pageForData[this.pageForIndex].MEMBER_NAME=res.data.map(item => {
							return item.text
						}).join(',')
					}
					
				}
				uni.$off('person');
			})
		}
	}
</script>

<style lang="scss" scoped>
	.wrap{
		padding-bottom: 60rpx;
	}
	page{
		padding-bottom: 20rpx;
	}

	.fixed-action-bar{
		width: 100%;
		display: flex;
		height: 70rpx;
		align-items: center;
		background: #fff;
		position: fixed;
		bottom: 0;
		left: 0;
		z-index: 999;
		.item{
			width: 50%;
			display: flex;
			justify-content: center;
			align-items: center;
			
		}
		.icon{
			width: 30rpx;
		}
		.btn-box{
			width: 140rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			height: 70rpx;
		}
		.text-edit{
			font-size: 24rpx;
			color: #0099cc;
			line-height: 70rpx;
		}
		.text-delete{
			font-size: 24rpx;
			color: #cc3357;
			line-height: 70rpx;
		}
	}
	
	
	.tabbar-box{
		width: 750rpx;
		height: 70rpx;
		margin-top: 10rpx;
	}
	.care-all{
		height: 230rpx;
		// padding-top: 22rpx;
		padding: 22rpx 34rpx 0 34rpx;
		background: #fff;
		.cate-section {
			width:682rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			flex-wrap:wrap;
			
			.cate-item {
				width: 20%;
				display: flex;
				flex-direction: column;
				align-items: center;
				font-size:26rpx;
				color: #303133;
				margin-bottom: 20rpx;
			}
			image {
				width: 50rpx;
				height: 50rpx;
				margin-bottom: 10rpx;
				// border-radius: 50%;
			}	
		}
	}
</style>
